package observers;

import highscore.SimpleWriteRead;
import java.io.File;
import configuration.Configuration;
import java.io.IOException; 
import java.io.FileNotFoundException; 

public class LogFile extends Log {
	
	private File logFile = new File(Configuration.LOG_OBSERV_FILE);
	
	public void logInfo(String n) throws IOException, FileNotFoundException {
		String data = SimpleWriteRead.getContents(logFile) + n; 
		if(logFile.exists()){
			try {
				SimpleWriteRead.setContents(logFile, data); //make it so it appends the original contents of the file instead of overwriting
			} catch (FileNotFoundException e) {
				new FileNotFoundException("File not found!"); 
			}
		}
	}
}
